package com.link.base.tencent.youtu.dao.mybatis.mapper;

import com.link.base.tencent.youtu.model.*;
import com.link.base.tencent.youtu.model.*;

import java.util.List;

/**
 * 优图 mapper
 *
 * @author ouyangzhenqiang
 * @date 2018/12/29
 */
public interface YoutuMapper {

    /**
     * 基于门店Id获取其下分组列表
     *
     * @author ouyangzhenqiang
     * @date 2018/11/29
     * @param record
     * @return
     * @throws Exception
     */
    List<Group> getGroupListByStoreId(Store record) throws Exception;

    /**
     * 基于分组&个体中间表，获取分组Id下的所有person
     *
     * @author ouyangzhenqiang
     * @date 2018/11/29
     * @param record
     * @return
     * @throws Exception
     */
    List<GroupPerson> getPersonListByGroupId(GroupPerson record) throws Exception;

    /**
     * 基于个体Id获取其下所有的face信息
     *
     * @author ouyangzhenqiang
     * @date 2018/11/29
     * @param record
     * @return
     * @throws Exception
     */
    List<Face> getFaceListByPersonId(Person record) throws Exception;

    /**
     * 删除分组基于Id
     *
     * @author ouyangzhenqiang
     * @date 2018/12/18
     */
    void delGroupById(Group record) throws Exception;

    /**
     * 基于个体Id删除其下所有人脸记录
     *
     * @author ouyangzhenqiang
     * @date 2018/11/29
     * @param record
     * @throws Exception
     */
    void delFaceByPersonId(Person record) throws Exception;

    /**
     * 基于分组Id删除其下所有个体记录
     *
     * @author ouyangzhenqiang
     * @date 2018/11/29
     * @param record
     * @throws Exception
     */
    void delPersonByGroupId(GroupPerson record) throws Exception;

    /**
     * 基于分组Id删除分组&个体中间表
     *
     * @author ouyangzhenqiang
     * @date 2018/11/29
     * @param record
     * @throws Exception
     */
    void delGroupPersonByGroupId(GroupPerson record) throws Exception;

    /**
     * 清空接待头
     *
     * @author ouyangzhenqiang
     * @date 2018/11/29
     * @param record
     * @throws Exception
     */
    void delReception(Reception record) throws Exception;

    /**
     * 清空接待行
     *
     * @author ouyangzhenqiang
     * @date 2018/11/29
     * @param record
     * @throws Exception
     */
    void delReceptionList(Reception record) throws Exception;

    /**
     * 新建分组
     *
     * @author ouyangzhenqiang
     * @date 2018/11/29
     * @param record
     * @throws Exception
     */
    void groupInsertByInterface(Group record) throws Exception;

    /**
     * Link创建个体
     *
     * @author ouyangzhenqiang
     * @date 2018/11/29
     * @param record
     * @throws Exception
     */
    void linkPersonInsertByInterface(Person record) throws Exception;

    /**
     * Link创建个体分组中间表记录
     *
     * @author ouyangzhenqiang
     * @date 2018/11/29
     * @param record
     * @throws Exception
     */
    void linkGroupPersonInsertByInterface(GroupPerson record) throws Exception;

    /**
     * 通过优图personId获取Link的personId
     *
     * @author ouyangzhenqiang
     * @date 2018/11/29
     * @param record
     * @return
     * @throws Exception
     */
    Person getLnkPersonIdByYoutuPersonId(Person record) throws Exception;

    /**
     * Link创建人脸
     *
     * @author ouyangzhenqiang
     * @date 2018/11/29
     * @param record
     * @throws Exception
     */
    void linkFaceInsertByInterface(Face record) throws Exception;

    /**
     * Link删除人脸
     *
     * @author ouyangzhenqiang
     * @date 2018/11/29
     * @param record
     * @throws Exception
     */
    void deleteFaceById(Face record) throws Exception;

    /**
     * 获取个体下创建时间最旧的一张face
     *
     * @author ouyangzhenqiang
     * @date 2018/11/29
     * @param record
     * @return
     * @throws Exception
     */
    Face getLastFaceByPersonId(Face record) throws Exception;

    /**
     * 新建接待头信息
     *
     * @author ouyangzhenqiang
     * @date 2018/11/29
     * @param record
     * @throws Exception
     */
    void receptionInsertByInterface(Reception record) throws Exception;

    /**
     * 新建接待行信息
     *
     * @author ouyangzhenqiang
     * @date 2018/11/29
     * @param record
     * @throws Exception
     */
    void receptionListInsertByInterface(ReceptionList record) throws Exception;

    /**
     * 通过接待头Id获取接待上的face信息，并构造face对象
     *
     * @author ouyangzhenqiang
     * @date 2018/11/29
     * @param record
     * @return
     * @throws Exception
     */
    Reception getFaceInfoByReceptionId(Reception record) throws Exception;

    /**
     * 更新接待头信息
     *
     * @author ouyangzhenqiang
     * @date 2018/11/29
     * @param record
     * @throws Exception
     */
    void updateReceptionById(Reception record) throws Exception;

    /**
     * 获取门店基本信息，通过门店Id
     *
     * @author ouyangzhenqiang
     * @date 2018/11/29
     * @param record
     * @return
     * @throws Exception
     */
    Store getStoreInfoById(Store record) throws Exception;

    /**
     * 根据门店Id获取门店下的所有用户信息
     *
     * @author ouyangzhenqiang
     * @date 2018/12/21
     */
    List<Store> getStoreUserListByStoreId(Store record) throws Exception;
    
}
